package com.woniu;

import com.woniu.pojo.User;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "user-service",path = "/user")
public interface UserFeignClient {

    @ApiOperation("通过id查询")
    @GetMapping("/{id}")
    public Result<User> getById(@PathVariable("id") Integer id);

    @ApiOperation("新增")
    @PostMapping
    public Result add(@RequestBody User user);
}
